package com.example.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.entity.ServerMonitorData;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import java.time.LocalDateTime;
import java.util.List;

/**
 * 服务器监控数据Mapper接口
 */
@Mapper
public interface ServerMonitorDataMapper extends BaseMapper<ServerMonitorData> {
    
    /**
     * 获取指定时间范围内的监控数据
     */
    @Select("SELECT * FROM server_monitor_data WHERE server_id = #{serverId} " +
            "AND collect_time BETWEEN #{startTime} AND #{endTime} " +
            "ORDER BY collect_time ASC")
    List<ServerMonitorData> getMonitorDataByTimeRange(Long serverId, LocalDateTime startTime, LocalDateTime endTime);
} 